const ROOMINFO = "liveRoomInfo"; //直播间信息
const RANKINFO = "roomRankInfo"; //排行榜信息
const CHATINFO = "roomChatInfo"; //聊天消息
const LMUSERID = "lm_user_id"; //连麦的用户ID
const LMITEMID = "lm_item_id"; //连麦的那条ID
const LIVETYPE = "live_type"; //直播类型

export default {
	/**
	 * 存储直播间信息
	 */
	setLiveRoomInfo(info) {
		uni.setStorageSync(ROOMINFO, info)
	},
	/**
	 * 清除直播间信息
	 */
	clearLiveRoomInfo() {
		uni.removeStorageSync(ROOMINFO)
	},
	/**
	 * 获取直播间信息
	 */
	getLiveRoomInfo() {
		return uni.getStorageSync(ROOMINFO)
	},
	
	
	
	
	/**
	 * 存储直播间在线榜单的信息
	 */
	setRoomRankInfo(info) {
		uni.setStorageSync(RANKINFO, info)
	},
	/**
	 * 清除直播间在线榜单信息
	 */
	clearRoomRankInfo() {
		uni.removeStorageSync(RANKINFO)
	},
	/**
	 * 获取直播间在线榜单信息
	 */
	getRoomRankInfo() {
		return uni.getStorageSync(RANKINFO)
	},
	
	
	
	/**
	 * 存储直播的类型 1-商户 2-技师
	 */
	setLiveType(type) {
		uni.setStorageSync(LIVETYPE, type)
	},
	getLiveType() {
		return uni.getStorageSync(LIVETYPE)
	},
	clearLiveType() {
		uni.removeStorageSync(LIVETYPE)
	},
	
	
	
	/**
	 * 存储连麦用户的ID
	 */
	setLMUserID(userID) {
		uni.setStorageSync(LMUSERID, userID)
	},
	/**
	 * 获取连麦用户ID
	 */
	getLMUserID() {
		return uni.getStorageSync(LMUSERID)
	},
	/**
	 * 清除连麦用户ID
	 */
	clearLMUserID() {
		uni.removeStorageSync(LMUSERID)
	},
	
	
	
	
	/**
	 * 存储连麦的那条记录ID
	 */
	setLMItemID(id) {
		uni.setStorageSync(LMITEMID, id)
	},
	/**
	 * 获取连麦用户ID
	 */
	getLMItemID() {
		return uni.getStorageSync(LMITEMID)
	},
	/**
	 * 清除连麦用户ID
	 */
	clearLMItemID() {
		uni.removeStorageSync(LMITEMID)
	},
	
	
	
	
	
	
	
	
	
	/**
	 * 获取用户ID
	 */
	getUserID() {
		return uni.getStorageSync('userInfo')['user_id'] || ""
	},
	/**
	 * 获取用户token
	 */
	getToken(token) {
		return  uni.getStorageSync('userInfo')['shop_token'] || ''
	},
	
	
	
	
	/**
	 * 退出直播间清除
	 */
	emitRoomAllClear() {
		this.clearLiveRoomInfo()
		this.clearRoomRankInfo()
		this.clearLiveType()
	},
}